﻿CREATE PROCEDURE [dbo].[AddMarkDetail]
	@Mark uniqueidentifier,
	@MarkDetailId uniqueidentifier,
    @Name nvarchar(50),
	@Value nvarchar(max),
	@DetailType int,
    @IsDeleted bit,
    @CreatedBy uniqueidentifier,
	@CreatedOn datetime,
    @LastChanged datetime,
	@LastChangedBy uniqueidentifier,

	@TimeStamp timestamp output

AS

	INSERT INTO MarkDetail

	(Mark, MarkDetailId, Name, Value, DetailType, IsDeleted, CreatedBy, CreatedOn, LastChanged, LastChangedBy)

	VALUES 

	(@Mark, @MarkDetailId, @Name, @Value, @DetailType, @IsDeleted, @CreatedBy, @CreatedOn, @LastChanged, @LastChangedBy)

	SELECT @TimeStamp = [TimeStamp]

	FROM MarkDetail WHERE MarkDetailId = @MarkDetailId

RETURN 0